package com.akk.module.avs.model.response;


import com.akk.module.avs.entity.AvsYbTags;

import java.util.Comparator;
import java.util.List;

public class AvsYbCardMatchRes implements Comparator {

    private Long cardId;

    private List<AvsYbTags> tags;

    private String cardName;

    private String cardUrl;

    private String cardImage;

    private Float match;

    public Long getCardId() {
        return cardId;
    }

    public void setCardId(Long cardId) {
        this.cardId = cardId;
    }

    public List<AvsYbTags> getTags() {
        return tags;
    }

    public void setTags(List<AvsYbTags> tags) {
        this.tags = tags;
    }

    public String getCardName() {
        return cardName;
    }

    public void setCardName(String cardName) {
        this.cardName = cardName;
    }

    public String getCardUrl() {
        return cardUrl;
    }

    public void setCardUrl(String cardUrl) {
        this.cardUrl = cardUrl;
    }

    public String getCardImage() {
        return cardImage;
    }

    public void setCardImage(String cardImage) {
        this.cardImage = cardImage;
    }

    public Float getMatch() {
        return match;
    }

    public void setMatch(Float match) {
        this.match = match;
    }

    @Override
    public int compare(Object o1, Object o2) {
        if (o1 != null && o2 != null){
            AvsYbCardMatchRes res1 = (AvsYbCardMatchRes) o1;
            AvsYbCardMatchRes res2 = (AvsYbCardMatchRes) o2;
            if (res1.getMatch() < res2.getMatch())
                return 1;
            else if (res1.getMatch() > res2.getMatch())
                return -1;
            else
                return 0;
//            return res1.getMatch().compareTo(res2.getMatch());
        }
        return 0;
    }
}
